package org.dei.perla.sys.device.channel.frame.header.concrete.simple;

import org.dei.perla.sys.device.channel.frame.address.concrete.SimpleFrameAddress;
import org.dei.perla.sys.device.channel.frame.header.FrameHeader;


/**
 * Un FrameAddress di esempio che utilizza indirizzi a SimpleFrameAddress
 *
 */
public class SimpleFrameHeader extends FrameHeader {
	
	public SimpleFrameHeader() {
		this.pSourceAddress = null;
		this.pDestAddress 	= null;
	}
	
	@Override
	public SimpleFrameAddress getDestinationAddress() {
		return (SimpleFrameAddress) super.getDestinationAddress();
	}

	@Override
	public SimpleFrameAddress getSourceAddress() {
		return (SimpleFrameAddress) super.getSourceAddress();
	}

	@Override
	public FrameHeader clone() {
		FrameHeader c = new SimpleFrameHeader();
		c.setSourceAddress(this.pSourceAddress);
		c.setDestinationAddress(this.pDestAddress);
		return c;
	}
	
	public String toString() {
		String s = "SimpleFrameHeader ( ";
		s += "src :" + getSourceAddress().toString() + ", ";
		s += "dst :" + getDestinationAddress().toString() + " )";
		return s;
	}

}
